<?php
/**
 * Created by PhpStorm.
 * User: lee
 * Date: 2018/1/9
 * Time: 下午3:39
 */

namespace Biz\model\trade;

use Doraemon\tools\Log;

class OrderPayRefund extends \Doraemon\pockets\datebase\BaseDbModel
{
    const _CONFIG_FILE_ = 'db_shop';

    const _CONFIG_SELECT_ = 'db_trade';

    const _DATABASE_ = 'shop_trade';

    const _TABLE_NAME = 'order_pay_refund';

    const STATUS_SUCCESS = 1;


    //pay_way的值
    const PAY_WAY_ALIPAY_APP = 'alipay';//支付宝APP支付
    const PAY_WAY_WXPAY_APP = 'wechat';//微信APP支付


    public static function addRefundOrderInfo($payWay, $orderNo, $refundOrderNo, $payNo, $refundPayNo, $payAmount, $refundAmount, $resultData)
    {
        self::insert([
            'order_no' => $orderNo,
            'refund_no' => $refundOrderNo,
            'pay_way' => $payWay,
            'pay_no' => $payNo,
            'pay_amount' => $payAmount,
            'pay_refund_no'=>$refundPayNo,
            'refund_amount' => $refundAmount,
            'request_info' => json_encode($resultData),
            'refund_time' => date('Y-m-d H:i:s'),
            'status' => self::STATUS_SUCCESS
        ]);
    }

}